package org.jeecg.modules.system.problem.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.modules.param.member.entity.BikeMemberUser;
import org.jeecg.modules.param.member.mapper.BikeMemberUserMapper;
import org.jeecg.modules.system.problem.entity.BikeProblemAppeal;
import org.jeecg.modules.system.problem.mapper.BikeProblemAppealMapper;
import org.jeecg.modules.system.problem.service.IBikeProblemAppealService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 问题管诉求理
 * @Author: 月月鸟
 * @Date:   2021-07-01
 * @Version: V1.0
 */
@Service
public class BikeProblemAppealServiceImpl extends ServiceImpl<BikeProblemAppealMapper, BikeProblemAppeal> implements IBikeProblemAppealService {
    @Resource
    private BikeMemberUserMapper bikeMemberUserMapper;
    @Override
    public IPage<BikeProblemAppeal> addUserList(IPage<BikeProblemAppeal> pageList) {

        List<BikeProblemAppeal> records = pageList.getRecords();
        for (BikeProblemAppeal tb : records){
            BikeMemberUser memberUser = bikeMemberUserMapper.selectById(tb.getUserId());
            if (memberUser!=null){
                tb.setUserCode(memberUser.getCode());
                tb.setUserName(memberUser.getName());
            }
        }

        return pageList;
    }
}
